package com.kuizii.discovery.client;

import com.kuizii.common.LiteServiceRegistration;
import com.kuizii.discovery.net.IOManager;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.cloud.client.serviceregistry.ServiceRegistry;

public class LiteServiceRegistry implements ServiceRegistry<Registration> {

    IOManager ioManager;
    DiscoveryProperties properties;

    public LiteServiceRegistry(IOManager ioManager,DiscoveryProperties properties) {
        this.ioManager = ioManager;
        this.properties=properties;

    }

    @Override
    public void register(Registration registration) {
        ioManager.registerService((LiteServiceRegistration) registration);
    }

    @Override
    public void deregister(Registration registration) {
        ioManager.deregisterService(registration.getServiceId(), (LiteServiceRegistration) registration);
    }

    @Override
    public void close() {

    }

    @Override
    public void setStatus(Registration registration, String status) {

    }

    @Override
    public <T> T getStatus(Registration registration) {
        return null;
    }
}
